import Vue from "vue";
import Router from "vue-router";
import Home from "@/components/Home.vue";
import Classes from "@/components/pages/Classes.vue";
import Students from "@/components/pages/Students.vue";
import StudentInClass from "@/components/pages/StudentInClass.vue";

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: "/",
      redirect: "/login"
    },
    {
      path: "/login",
      name: "Login",
      component: () => import("../components/login/Login.vue")
    },
    {
      path: "/home",
      name: "Home",
      component: Home,
      children: [
        {
          path: "/students",
          name: "Students",
          component: Students
        },
        {
          path: "/classes",
          name: "Classes",
          component: Classes
        },
        {
          path: "/stuclass",
          name: "StudentInClass",
          component: StudentInClass
        }
      ]
    }
  ]
});
